package com.meeting.controller.employee;

import com.github.pagehelper.Page;
import com.meeting.dto.OrdersQueryDTO;
import com.meeting.entity.Orders;
import com.meeting.service.EmpService;
import com.meeting.service.OrdersService;
import com.meeting.vo.OrdersVO;
import com.meeting.vo.Result;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/emp/orders")
@Tag(name = "员工订单接口")
@Slf4j
public class EmpOrdersController {
    @Autowired
    private OrdersService ordersService;

    @GetMapping
    public Result listOrders(OrdersQueryDTO ordersQueryDTO){
        log.info("展示所有需要审核的订单");
        ordersQueryDTO.setStatus(6);
        return Result.success(ordersService.listAllRefundOrders(ordersQueryDTO));
    }

    @PutMapping("/{id}")
    public Result changeOrders(@PathVariable Integer id){
        log.info("审核退款订单");
        ordersService.changeOrders(id);
        return Result.success();
    }


}